perf(auth): 将 API Key 校验缓存 TTL 延长至五分钟 - #291
Merged
Merged
Conversation
将 API_KEY_VERIFY_CACHE_TTL_MS 从 120000 调整为 300000。 同步五分钟过期边界测试与鉴权生命周期文档。 验证:聚焦测试、全量测试、lint、format:check、tsc、build 均通过。
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #291 +/- ##
=======================================
Coverage 72.54% 72.54%
=======================================
Files 245 245
Lines 14519 14519
Branches 4837 4837
=======================================
Hits 10533 10533
Misses 2600 2600
Partials 1386 1386
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
将
API_KEY_VERIFY_CACHE_TTL_MS从 120000 毫秒调整为 5 分钟(300000 毫秒),提高重复 API Key 校验的缓存命中窗口。Related Issue
无关联 Issue。
Type of Change
Changes
API_KEY_VERIFY_CACHE_TTL_MS设置为5 * 60 * 1000。request-lifecycle.md中的缓存 TTL 说明。Test Plan
pnpm test:run)pnpm exec tsc --noEmit)pnpm lint)已验证:聚焦鉴权测试 30 passed;全量测试 245 files、3646 passed、1 skipped;
format:check、production build 与 pre-commit hooks 均通过。构建仅有已知的 Turbopack NFT tracing warning。Checklist
Screenshots
不适用。
Additional Notes
本 PR 仅包含 TTL、对应边界测试和架构文档三项变更。工作区中原有的落地页未提交改动未包含在本 PR 中。